//
//  ATRectButton.m
//  Postre
//
//  Created by CoderLT on 2017/6/1.
//  Copyright © 2017年 CoderLT. All rights reserved.
//

#import "ATRectButton.h"

@implementation ATRectButton
- (void)awakeFromNib {
    [super awakeFromNib];
    [self setup];
}
- (void)setup {
    [super setup];
    
    self.titleLabel.font = [UIFont systemFontOfSize:16.0f];
    [self setTitleColor:[UIColor appColor] forState:UIControlStateNormal];
    [self setTitleColor:[UIColor appColorDisable] forState:UIControlStateDisabled];
    self.clipsToBounds = YES;
    self.layer.cornerRadius = self.cornerRadius;
    self.layer.borderWidth = 1.0f;
    self.layer.borderColor = [UIColor appColor].CGColor;
}

- (void)setEnabled:(BOOL)enabled {
    [super setEnabled:enabled];
    
    self.layer.borderColor = enabled ? [UIColor appColor].CGColor : [UIColor appColorDisable].CGColor;
}
@end
